# Contributor: Peter Shkenev <santurysim@gmail.com>
# Maintainer: Peter Shkenev <santurysim@gmail.com>
pkgname=gajim
pkgver=1.9.5
pkgrel=0
_pkgver_suffix=""
pkgdesc="A full featured and easy to use XMPP client"
url="https://gajim.org/"
arch="noarch"
license="GPL-3.0-only"
depends="
	dbus
	gtk+3.0
	gtksourceview4
	libsoup3
	py3-cairo
	py3-css-parser
	py3-emoji
	py3-gobject3
	py3-keyring
	py3-nbxmpp
	py3-omemo-dr
	py3-openssl
	py3-packaging
	py3-pillow
	py3-precis-i18n
	py3-qrcode
	py3-sqlalchemy
	sqlite
	pango
	"
makedepends="
	gettext-dev
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	"
checkdepends="xvfb-run font-dejavu py3-pytest"
source="
	https://gajim.org/downloads/${pkgver:0:3}/gajim-$pkgver$_pkgver_suffix.tar.gz
	disable-test.patch
	"
subpackages="$pkgname-doc $pkgname-lang $pkgname-pyc"

build() {
	./make.py build
	gpep517 build-wheel \
		--wheel-dir dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer dist/*.whl
	xvfb-run -a .testenv/bin/python3 -m pytest #unittest discover -s test
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/*.whl
	./make.py install --prefix "$pkgdir"/usr
}

lang() {
	pkgdesc="Languages for package $pkgname"
	amove usr/lib/python3*/site-packages/gajim/data/locale
}

sha512sums="
00adfffa255ecbd73227967f86be02549403e81801339dbd896c9c48c3717e7f99d7c1d70d3629b2b242e60ddba6037a9877f264af6f8b6b0d7d30666a54e5f5  gajim-1.9.5.tar.gz
228ec0c9a92e88861888d64a5077f19a6b87b1e29f712c5db23601add69406c0ef0e865780db6b1deaae28397969978869dde18704cc0bbb5a37f8ef564760f7  disable-test.patch
"
